1. Field of the Invention
The invention relates in general to the technical field of memory management in the execution of a program by a portable data carrier having a processor. A portable data carrier of such a kind can be especially a chip card in various constructional forms or a chip module. The invention relates more particularly to the use of two different memory regions of the data carrier in order to store objects generated during program execution.
2. Description of Related Art
In portable data carriers there are generally provided a plurality of memory regions which are constructed in various memory technologies. Typically, the memory is subdivided into a volatile read/write memory (RAM), a non-volatile writable memory (EEPROM) and a mask-programmed fixed value memory (ROM). A write-to-RAM operation requires substantially less time—for example, less by a factor of 30—than a write-to-EEPROM operation. On the other hand, one bit in RAM takes up a substantially greater area on a semiconductor chip of the data carrier than one bit in EEPROM so that usually only relatively little RAM is provided. The problem accordingly exists of utilizing the fast but scarce RAM in the best and most flexible manner possible.
Portable data carriers with complex memory management functions are known, for example, under the trademark Java Card™. The document “Java Card™ 2.2 Runtime Environment (JCRE) Specification”, June 2002, published by the company Sun Microsystems, Inc., Palo Alto, USA, available on the Internet under http://java.sun.com/products/javacard, describes the environment provided in a Java Card for the execution of programs (Java Card Applets). Chapter 5 describes that persistent objects are typically stored in the EEPROM of the data carrier whereas transient objects are typically created in the RAM. For reasons of security, it is not allowed to store transient objects in the EEPROM.
In the memory management of a Java Card just described, special system calls are used for generating transient objects, as described, for example, on pages 81-85 of the document “Java Card™ 2.2 Application Programming Interface”, June 2002, published by the company Sun Microsystems, Inc., Palo Alto, USA, available on the Internet under the above-mentioned address. This limits the extent to which transient objects are utilized in practice. In addition thereto, transient objects as such have a potentially unlimited life; the term “transient” refers merely to the data stored in the objects. Using transient objects therefore brings about only a slight increase in flexibility in memory management.
The customary and recommended practice in programming a Java Card is that all objects required during the entire life of a program (Applet) are statically created on installation of the program. This is carried out in a method having the prespecified name “install”. The said practice results, however, in memory management which is of low flexibility and, therefore, not optimal. When, for example, a transient field is created in a program in order to store temporary data for cryptographic operations, the memory space statically reserved therefor in the RAM is generally unavailable to other programs. Within the program, the extent to which such reserved memory space is also used for other tasks depends on the expertise of the programmer. It would therefore be desirable to improve utilization of the scarce memory space in the RAM and to automate memory management.